package com.ynding.spring.physical.redis.meta.controller;

import com.ynding.spring.physical.redis.meta.queue.delayed.QueueTestListener;
import com.ynding.spring.physical.redis.meta.queue.delayed.RedisDelayedQueue;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p> 队列测试类</p>
 *
 * @author ynding
 * @version 2022/4/20
 **/
@Api(tags = "redis延迟队列测试类")
@RestController
@RequiredArgsConstructor
@Slf4j
@RequestMapping("/delayed")
public class RedisDelayedController {

    private final RedisDelayedQueue redisDelayedQueue;

    @ApiOperation(value = "发送延迟队列")
    @GetMapping("/sendQueue")
    public void sendQueue() {
        redisDelayedQueue.addQueueHours("test....", 2, QueueTestListener.class);
    }

}
